package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;

/*Reader和Writer字符流*/
public class OswDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("osw.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        osw.write("童话说雨后会有彩虹");
        osw.write("却不曾说过它也会转瞬成空");
        System.out.println("写出完成");
        osw.close();
    }
}
